<%@ page language="java" contentType="text/html;charset=utf-8" pageEncoding="utf-8"%>

<%@ include file="/core/taglibs.jsp"%>
<!DOCTYPE html>
<html lang="zh-CN">
  
<head>
 	<%@ include file="/core/memberMeta.jsp"%>
	<script type="text/javascript"> 
		var checkSubmitFlg = false; 
		
		
		function checkSubmit() {  
			if ($("#loginName").val() == "") {
				alert("请输入用户名。");
				 
				return false;
			}  
			
			if ($("#onePassword").val().length < 6) {
				alert("登陆密码不够六位");
				
				return false;
			}
			if ($("#onePasswordRec").val() != $("#onePassword").val()) {
				alert("两次一级密码不一样");
				
				return false;
			}
			if ($("#twoPassword").val().length < 6) {
				alert("安全密码不够六位");
				
				return false;
			}
			if ($("#twoPassword").val() != $("#twoPasswordRec").val()) {
				alert("两次安全密码不一样");
				
				return false;
			}
			
			 
			
			if (checkSubmitFlg == true) {   
				return false;   
			}   
			checkSubmitFlg = true;   
			return true;   
		}   
		document.ondblclick = function docondblclick() {   
			window.event.returnValue = false;   
		}   
		document.onclick = function doconclick() {   
			if (checkSubmitFlg) {   
				window.event.returnValue = false;   
			}   
		}   
	</script>
	<script type="text/javascript">
			 
		function recommendChange(){
			
			var recommendLoginName=$("#recommendLoginName").val(); 	
			 
			$.getJSON("<%=basePath%>/member/member/ajaxGetRecommendByName.shtml",{recommendLoginName: recommendLoginName},function(result){	 
				//填入新值
				if(result.success==true){
					
					$("#recommendPersonName").html("推荐人存在，姓名:"+result.member.personName);
				}else{
					 
					$("#recommendPersonName").html("<b  style='color: #ffff00;'>推荐人不存在</b>");
				}
				 
			});
		}
		
		function centerChange(){
			
			var centerLoginName=$("#centerLoginName").val(); 	
			 
			$.getJSON("<%=basePath%>/member/member/ajaxGetCenterByName.shtml",{centerLoginName: centerLoginName},function(result){	 
				//填入新值
				if(result.success==true){
					
					$("#centerPersonName").html("服务中心姓名:"+result.member.personName);
				}else{
					 
					$("#centerPersonName").html("<b  style='color: #ffff00;'>该会员不是服务中心</b>");
				}
				 
			});
		}
		
		function fatherChange(){
			
			var fatherLoginName=$("#fatherLoginName").val(); 	
			 
			$.getJSON("<%=basePath%>/member/member/ajaxGetFatherByName.shtml",{fatherLoginName: fatherLoginName},function(result){	 
				//填入新值
				if(result.success==true){
					
					$("#fatherPersonName").html("接点人姓名:"+result.member.personName);
				}else{
					 
					$("#fatherPersonName").html("<b  style='color: #ffff00;'>接点人不存在</b>");
				} 
				 
			});
		}
		
		function loginNameChange(){
			
			var loginName=$("#loginName").val(); 	
			 
			$.getJSON("<%=basePath%>/member/member/ajaxGetMemberByName.shtml",{loginName: loginName},function(result){	 
				//填入新值
				if(result.success==true){
					
					$("#loginNamePersonName").html("<b  style='color: blue;'>账号名可以用</b>");
				}else{
					$("#loginNamePersonName").html("<b  style='color: #ffff00;'>账号名已经存在</b>");
				}
				 
				
				 
			});
			 
			
		}
	</script>
</head>

<body data-type="widgets">
    <script src="<%=basePath%>/resources/memberCss/assets/js/theme.js"></script>
    <div class="am-g tpl-g">
        
        <!-- 内容区域 -->
        <div class="tpl-content-wrapper">

            <div class="container-fluid am-cf">
                <div class="row">
                    <div class="am-u-sm-12 am-u-md-12 am-u-lg-9">
                        <div class="page-header-heading"><span class="am-icon-user page-header-heading-icon"></span> 注册会员</div>
                        <p class="page-header-description">欢迎光临BHP必和必拓矿业投资中国区</p>
                    </div>
                     
                </div>

            </div>

            <div class="row-content am-cf">

                <div class="am-u-sm-12 am-u-md-12 am-u-lg-12">
                    <div class="widget am-cf">
                        <div class="widget-head am-cf">
                            <div class="widget-title am-fl">注册会员</div> 
                            <div class="widget-function am-fr">
                                <a href="javascript:;" class="am-icon-cog"></a>
                            </div>
                        </div>
                        <div class="widget-body am-fr">
 
                            <form class="am-form tpl-form-border-form tpl-form-border-br" action="<%=basePath%>/member/member/memberAdd.shtml" method="post" onsubmit="return checkSubmit();" >
                                <div class="am-form-group">
                                    <label for="user-name" class="am-u-sm-3 am-form-label">会员账号：</label>
                                    <div class="am-u-sm-9">
                                       	<input type="text"  id="loginName" name="loginName"  class="mws-textinput"  onchange="loginNameChange()"/><span style="color:#ffff00;">(*必填6位以上)</span>
										<span id="loginNamePersonName"></span>
                                    </div>
                                </div>

                                
                                <div class="am-form-group">
                                    <label for="user-email" class="am-u-sm-3 am-form-label">登陆密码：</label>
                                    <div class="am-u-sm-9">
                                         <input type="password" id="onePassword" name="onePassword"   />
									 	<span style="color:#ffff00;">(*必填6位以上)</span>
                                    </div>
                                </div>
                                <div class="am-form-group">
                                    <label for="user-email" class="am-u-sm-3 am-form-label">确认登陆密码：</label>
                                    <div class="am-u-sm-9">
                                        <input type="password" id="onePasswordRec"   name="onePasswordRec" />
										<span style="color: #ffff00">(*必填6位以上)</span>
                                    </div>
                                </div>
                                <div class="am-form-group">
                                    <label for="user-email" class="am-u-sm-3 am-form-label">安全密码：</label>
                                    <div class="am-u-sm-9">
                                        <input type="password" id="twoPassword" name="twoPassword" /> 
                                        <span style="color: #ffff00">(*必填6位以上)</span> 
							
                                    </div>
                                </div>
                                <div class="am-form-group">
                                    <label for="user-email" class="am-u-sm-3 am-form-label">确认安全密码：</label>
                                    <div class="am-u-sm-9">
                                        <input type="password" id="twoPasswordRec" name="twoPasswordRec" /> 
                                        <span style="color: #ffff00">(*必填6位以上)</span>
                                    </div>
                                </div>
                                
                             
                                <div class="am-form-group">
		                        	 <label for="user-email" class="am-u-sm-3 am-form-label">推荐人编号： </label>
		                        	 <div class="am-u-sm-9">
		                            	<input type="text"  id="recommendLoginName" name="recommendLoginName" class="mws-textinput"  onchange="recommendChange()"/>
										<span id="recommendPersonName"></span>
		                            </div>
		                        </div>
		                        
		                    	<div class="am-form-group">
							
									 <label for="user-email" class="am-u-sm-3 am-form-label">手机号码： </label>
									 <div class="am-u-sm-9">
		                            	<input type="text"  id="tel" name="tel" /> 
		                             </div>
								 
								</div>
								<div class="am-form-group">
							
								
									<label for="user-email" class="am-u-sm-3 am-form-label">姓名： </label>
									<div class="am-u-sm-9">
		                            	<input type="text"  id="personName" name="personName" /> 
		                            </div>
								</div>
								<div class="am-form-group">
									<label for="user-email" class="am-u-sm-3 am-form-label">微信：</label>
									<div class="am-u-sm-9">
		                            	<input type="text"  id="wei" name="wei" /> 
		                            </div>
								</div> 
								<div class="am-form-group">
									<label for="user-email" class="am-u-sm-3 am-form-label">QQ：</label>
									<div class="am-u-sm-9">
		                            	<input type="text"  id="qq" name="qq" /> 
		                            </div>
								</div>
								<div class="am-form-group">
									<label for="user-email" class="am-u-sm-3 am-form-label">身份证：</label>
									<div class="am-u-sm-9">
		                            	<input type="text"  id="cardNo" name="cardNo" /> 
		                            </div>
								</div>
								
								 
							  
		                       
		                        <div class="am-form-group" >
		                        	<div class="am-u-sm-9" style="text-align: center;color: #ffff00;">
		                        		${retMsg}
		                        	</div>
		                        </div>

                                 
                                 <div class="am-form-group">
                                     <div class="am-u-sm-9 am-u-sm-push-3">
                                         <button type="submit" class="am-btn am-btn-primary tpl-btn-bg-color-success ">提交</button>
                                     </div>
                                 </div>
                             </form>
                         </div>
                     </div>
                 </div>
             </div>
        </div>
    </div>
    </div>
    <script src="<%=basePath%>/resources/memberCss/assets/js/amazeui2.min.js"></script>
    <script src="<%=basePath%>/resources/memberCss/assets/js/amazeui.datatables.min.js"></script>
    <script src="<%=basePath%>/resources/memberCss/assets/js/dataTables.responsive.min.js"></script>
    <script src="<%=basePath%>/resources/memberCss/assets/js/app.js"></script>

</body>


